package main

import "fmt"

var guess int = 66

func main() {
	count := 3
	var num int
	for {
		fmt.Print("请输入一个数字：")
		_, _ = fmt.Scanln(&num)
		if num == guess {
			fmt.Print("登录成功")
			break
		} else {
			count--
			if count == 0 {
				break
			} else {
				fmt.Printf("登录失败，还有%d次机会\n", count)
			}
		}
	}
}
